package com.zhouyang.bootssh.api.books;

import com.zhouyang.bootssh.entity.books.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Auther: 周洋
 * @Date: 2018/11/14 14:27
 * @Description:
 */
@Api(value = "user接口")
public interface UserControllerApi {

     final String API_USER = "/user";

    @ApiOperation(value="我是添加一个用户", notes="添加一个用户到数据库")
    @ApiImplicitParam(name = "user", value = "用户详细实体user", required = true, dataType = "User")
    @PostMapping(API_USER+"/user")
    public String showUser(User user, Model model);

    @ApiOperation(value="跳转获取用户列表", notes="跳转获取用户列表notes")
    @RequestMapping(API_USER+"/selectUser")
    public String selectUser(Model model);

    @ApiOperation(value="ajax获取用户列表", notes="ajax获取用户列表notes")
    @RequestMapping(API_USER+"/ajaxSelectUser")
    @ResponseBody
    public List<User> ajaxSelectUser();

}
